<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class DropPhotoIdFromCommentsAndAddGalleryImgId extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('comments', function (Blueprint $table) {
			$table->dropForeign('comments_photo_id_foreign');
        	$table->dropColumn('photo_id');
            $table->bigInteger('gallery_img_id')->after('article_id');
            $table->foreign('gallery_img_id')->references('id')->on('gallery_imgs');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('comments', function (Blueprint $table) {
            //
        });
    }
}
